<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rd_alarm_broadcast_record', function (Blueprint $table) {
            $table->comment('广播记录');
            $table->bigIncrements('id')->comment('主键ID');
            $table->bigInteger('file_id')->nullable()->comment('文件id');
            $table->decimal('second', 10)->default(0.00)->comment('秒');
            $table->json('device')->nullable()->comment('广播id');
            $table->unsignedTinyInteger('type')->comment('类型 1:广播 2:喊话');
            $table->unsignedBigInteger('start_time')->comment('开始时间');
            $table->unsignedBigInteger('end_time')->comment('结束时间');
            $table->timestamps();
            $table->authorBy();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rd_alarm_broadcast_record');
    }
};